Skip to content

Conversation

@Jonathing
Copy link
Member

@Jonathing Jonathing commented Oct 25, 2025

This PR migrates Log Utils from the static Log class to the traditional Logger instance loggers. Here's my plan for this:

  • Deleting Log, since everything is going to be instance-based now. There's no real way I can preserve it without basically duplicating the entire project.
  • Interface Logger will define the contract for consumers using loggers.
  • Abstract class AbstractLogger defines the simplest implementation of a basic logger, only having method loggerFor(Logger.Level, String) to allow implementations to create a logger for each specific log level that can be stored by the logger.
    • Abstract logger can be created with an initial enabled log level (defaults to INFO) or indentation level.

This one was based on a suggestion from @LexManos. My original intention behind the single static Log was for simplicity and performance, but since every god damn logging framework is instance-based (including Java's), there's no real point if we need to have instance loggers anyway.

The only thing I haven't done yet are log tags, like prefixing messages with [Mavenizer] or something. I don't think it would play nice with the indentation system, so we'd likely have to choose between either that or the indentations.

@Jonathing Jonathing requested a review from LexManos October 25, 2025 03:16
@Jonathing Jonathing force-pushed the feat/jonathing/log-utils/0.4 branch 2 times, most recently from c6ad658 to 3491390 Compare October 25, 2025 21:19
@Jonathing Jonathing self-assigned this Oct 25, 2025
@Jonathing Jonathing marked this pull request as ready for review October 25, 2025 22:03
@Jonathing Jonathing force-pushed the feat/jonathing/log-utils/0.4 branch from f12361b to 5cc7bf2 Compare October 26, 2025 00:40
@Jonathing Jonathing force-pushed the feat/jonathing/log-utils/0.4 branch from 5cc7bf2 to aaca627 Compare October 26, 2025 00:42
@Jonathing Jonathing merged commit aaca627 into MinecraftForge:master Oct 26, 2025
@Jonathing
Copy link
Member Author

There are additional things that can be done for performance, but these can wait for a later update. For now, I need this in place so I can work on the updates for the tools that currently use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant